<html>
    <head>
        <title>Table Free-用户登录</title>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <link rel="stylesheet" media="all" href="common.css"></link>
        <style type="text/css">
            .cur-login-box{
	            border: 1px solid #DEDEDE;
                border-radius: 3px;
                box-shadow: 2px 2px 2px #DDD;
            }
        </style>
    </head>
    <body>
        <div class="fr-container fr-align-center fr-fullscreen">
		        <div class="fr-table fr-fullscreen">
			        <div class="fr-table-cell fr-vlign-middle">
			            <ul class="cur-login-box fr-col-3">
			                <li class="fr-row-40 fr-row-title">管理登录</li>
			                <li class="fr-row fr-row-40 fr-row-margin10">
				                <span class="fr-col-2 fr-align-right">帐号:</span>
                                <span class="fr-col-7 fr-align-left"><input type="text" name="account" id="account" value="" placeholder="请输入登录账号"></span>
			                </li>
			                <li class="fr-row fr-row-40 fr-row-margin10">
								<span class="fr-col-2 fr-align-right">密码:</span>
                                <span class="fr-col-7 fr-align-left"><input type="password" name="passwd" id="passwd" value="" placeholder="请输入登录密码"></span>
			                </li>
			                <li class="fr-row-margin10">
								<span id="loginbtn" class="fr-btn fr-btn-blue">登录</span> &nbsp; <span class="fr-btn fr-btn-gray">取消</span>
			                </li>
			            </ul>
		            </div>
	            </div>
        </div>
    </body>
    <script type="text/javascript" src="jquery.1.11.3.mini.js"></script>
    <script type="text/javascript" src="common.js"></script>
    <script type="text/javascript">
        $('#loginbtn').on('click', function(){
            var data = {
                'userName': $('input[name=account]').val(),
                'password': $('input[name=passwd]').val(),
            };
            if(data.userName.length == 0){
                return popup.toast('请输入登录帐号');
            }
            if(data.password.length == 0){
                return popup.toast('请输入登录密码');
            }
            request('/login.cgi', data, "post", function(ret){
                sessionStorage.setItem('username', data.userName);
                sessionStorage.setItem('ip', ret.ip);
                top.location.href = 'network.html';
            }, function(){
                return popup.toast('登录失败，请检查账号密码输入');
            });
        })
    </script>
</html>